import request from '/@/utils/request'
// 查询流程模型列表
export function listFlowModel(query:object) {
  return request({
    url: '/api/v1/flow/flowModel/list',
    method: 'get',
    params: query
  })
}
// 查询流程模型详细
export function getFlowModel(id:number) {
  return request({
    url: '/api/v1/flow/flowModel/get',
    method: 'get',
    params: {
      id: id.toString()
    }
  })
}
// 新增流程模型
export function addFlowModel(data:object) {
  return request({
    url: '/api/v1/flow/flowModel/add',
    method: 'post',
    data: data
  })
}
// 修改流程模型
export function updateFlowModel(data:object) {
  return request({
    url: '/api/v1/flow/flowModel/edit',
    method: 'put',
    data: data
  })
}
// 删除流程模型
export function delFlowModel(ids:number[]) {
  return request({
    url: '/api/v1/flow/flowModel/delete',
    method: 'delete',
    data:{
      ids:ids
    }
  })
}
//相关连表查询数据
export function linkedDataSearch(){
  return request({
    url: '/api/v1/flow/flowModel/linkedData',
    method: 'get'
  })
}

export function saveModeNode(data:object){
  return request({
    url: '/api/v1/flow/flowModel/saveModelNode',
    method: 'post',
    data: data
  })
}

export function getNodeData(modelId:number){
  return request({
    url: '/api/v1/flow/flowModel/getModelNode',
    method: 'get',
    params:{modelId:modelId}
  })
}
